package com.lsk.servicemap.controller;

import com.lsk.internalcommon.DTO.ResponseResult;
import com.lsk.internalcommon.request.ForecastPriceDTO;
import com.lsk.servicemap.service.DirectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/direction")
public class DirectionController {
    @Autowired
    private DirectionService directionService;

    @GetMapping("/driving")
    public ResponseResult driving(@RequestBody ForecastPriceDTO forecastPriceDTO){
        String deplongitude = forecastPriceDTO.getDeplongitude();
        String deplatitude = forecastPriceDTO.getDeplatitude();
        String destlongitude = forecastPriceDTO.getDestlongitude();
        String destlatitude = forecastPriceDTO.getDestlatitude();

        return directionService.driving(deplongitude,deplatitude,destlongitude,destlatitude);

    }
}
